Skip to main content

Method Definitions

Method definitions have a shorter syntax for defining a function method.

Here is an example of the syntax, given normal code:

tip

Create methods by doing this:

  • Write the name of the method follow by parameters if any, then a curly bracket which wraps the method's body!

Overall, there's not much more to method definitions and we've learned the standard way.

However, the more flexibility the better!